<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/common/head.jsp"%>
<div class="right">

	<div>
		<a href="${pageContext.request.contextPath}/frame">
			<img src="${pageContext.request.contextPath}/statics/images/home.png" alt="首页"/>
		</a>
		<h3 style="display: inline-block">当前位置：</h3>供货商管理页面
	</div>
	<div>
		<form action="${pageContext.request.contextPath }/supplier/list" method="post" style="line-height: 100px">
			<table id="search" style="display: inline-block;height: 100px">
				<tr>
					<td style="margin:20px;padding: 20px">
						供货商编号：<input type="text" name="supCode" value="${supCode}"/>
					</td>
					<td style="margin:20px;padding: 20px">
						供货商名称：<input type="text" name="supName" value="${supName}"/>
					</td>
				</tr>
			</table>
			<div style="height: 100px;display: inline-block">

				<input type="submit" value="查询" style="width: 80px;margin-left: 145px;text-align: center;"/>
				<input id="add" type="button" value="添加" style="width: 80px;margin-left: 145px;text-align: center;"/>
			</div>
		</form>
		<div>
			<table style="width: 100%;text-align: center" border="1">
				<tr>
					<th>供货商编码</th>
					<th>供货商名称</th>
					<th>联系人</th>
					<th>联系电话</th>
					<th>传真</th>
					<th>创建时间</th>
					<th>操作</th>
				</tr>
				<c:forEach var="supplier" items="${list }">
					<tr>
						<td>${supplier.supCode }</td>
						<td>${supplier.supName }</td>
						<td>${supplier.supContact }</td>
						<td>${supplier.supPhone }</td>
						<td>${supplier.supFax }</td>
						<td><fmt:formatDate value="${supplier.createdTime }" pattern="yyyy-MM-dd"/></td>
						<td>
							<a id="info" href="${pageContext.request.contextPath }/supplier/info?id=${supplier.id}">
								<img src="${pageContext.request.contextPath}/statics/images/view.png" alt="详情"/>
							</a>
							<a id="update" href="${pageContext.request.contextPath }/supplier/toUpdate?id=${supplier.id}">
								<img src="${pageContext.request.contextPath}/statics/images/xiugai.png" alt="修改"/>
							</a>
							<a id="delete" href="${pageContext.request.contextPath }/supplier/delete?id=${supplier.id}">
								<img src="${pageContext.request.contextPath}/statics/images/del.png" alt="删除"/>
							</a>
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<div class="page-bar">
			<ul class="page-num-ul">
				<li>共${count}条记录</li>
				<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
				<c:if test="${pageIndex > 1}"><li><a href="${pageContext.request.contextPath }/supplier/list?pageIndex=${pageIndex - 1}&supCode=${supCode}&supName=${supName}">上一页</a></li></c:if>
				<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
				<li>${pageIndex}/${pageCount}页</li>
				<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
				<c:if test="${pageIndex < pageCount}"><li><a href="${pageContext.request.contextPath }/supplier/list?pageIndex=${pageIndex + 1}&supCode=${supCode}&supName=${supName}">下一页</a></li></c:if>
			</ul>
			<div class="page-go-form">
				<form action="${pageContext.request.contextPath }/supplier/list" method="post">
					<input style="display: none" name="supCode" value="${supCode}"/>
					<input style="display: none" name="supName" value="${supName}"/>
					<label>
						跳转至<input type="text" name="pageIndex"/>页
					</label>
					<button type="submit">Go</button>
				</form>
			</div>
		</div>
	</div>
</div>
<script src="${pageContext.request.contextPath}/statics/js/jquery-1.8.3.min.js"></script>
<script>
	$(document).ready(function (){
		$("#add").click(function (){
			location.href="${pageContext.request.contextPath }/supplier/toAdd";
		})
	})
</script>
</section>
<%@include file="/WEB-INF/jsp/common/foot.jsp" %>